<template>
  <div class="app-container container" style="min-height: calc(100vh - 60px - 40px - 20px)">
    <div class="box">
      <div class="one">
        <div class="title">快速构建系统的第一个页面</div>
        <div class="desc">点击下方模块快速构建表单、外部链接页面</div>
      </div>
      <div class="second">
        <div v-for="(item,i) in list" :key="item.title" :style="{background:`linear-gradient(${item.bg})`}"
             :class="['box-item',{'big-box':i===0 || i===1},{'small-box':i!==0&&i!==1},{'space':i===1 || i===4}]" @click="open(item)">
          <div class="title">{{ item.title }}</div>
          <div class="icon_box">
            <svg-icon :icon-class="item.icon" class="icon" />
            <span :style="{color:item.iconColor}" class="plus">+</span>
          </div>
          <div class="desc">{{ item.desc }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    appCode: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      selectObj: {},
      list: [{
        title: '新建表单',
        icon: 'new_form_icon',
        desc: '数据收集、事件跟进',
        bg: '180deg, #E2EAFF 0%, #FFFFFF 71%',
        iconColor: '#3461FF',
        type: 0
      // }, {
      //   title: '新建报表',
      //   icon: 'new_report_icon',
      //   desc: '数据分析、图表展示',
      //   bg: '180deg, #FFF9E2 0%, #FFFFFF 71%',
      //   iconColor: '#FF8F1F'
      // }, {
      //   title: '新建大屏',
      //   icon: 'new_largeScreen',
      //   desc: '数据分析、大屏展示',
      //   bg: '180deg, #E2FFEB 1%, #FFFFFF 71%',
      //   iconColor: '#00B578'
      }, {
        title: '外部链接',
        icon: 'new_outSide_url',
        desc: '链接到外部页面',
        bg: '180deg, #E2E3FF 0%, #FFFFFF 74%',
        iconColor: '#8A38F5',
        type: 2
      }, 
      // {
      //   title: '新建自定义页面',
      //   icon: 'new_custom_index',
      //   desc: '导航、看板、信息展示',
      //   bg: '180deg, #E2FFFD 0%, #FFFFFF 71%',
      //   iconColor: '#07B9B9'
      // }
    ]
    }
  },
  methods: {
    // 打开弹窗
    open(item) {
      if (item.type === undefined) {
        this.$dtModal.msgWarning(`“${item.title}”暂未开通`)
        return
      }
      this.$emit('openDialog', {
        title: item.title,
        type: item.type
      }, '-1')
    }
  }
}
</script>

<style lang="scss" scoped>
.container{
    padding:16px;
    display: flex;
}
.box{
  flex: 1;
    padding-top: 90px;
    background-color: #fff;
    .one{
        text-align: center;
        color: #3D3D3D;
        padding-bottom: 52px;
        .title{
            font-size: 22px;
            line-height: 28px;
            font-weight: 500;
        }
        .desc{
            line-height: 22px;
            margin-top:16px;
            font-size: 14px;
        }
    }
}

.second{
    width: 798px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    .box-item{
        cursor: pointer;
        box-sizing: border-box;
        border-radius: 8px;
        border: 1px solid #EBEEF5;
        text-align: center;
        // height: 282px;
        padding-top: 20px;
        margin-bottom: 24px;
        &.big-box{
            width: 387px;
            margin-right: 24px;
        }
        &.small-box{
            width: 250px;
            margin-right: 24px;
        }
        &.space{
            margin-right: 0;
        }
        .title{
            font-size: 16px;
            line-height: 23px;
            color: #131414;
            font-weight: 500;
        }
        .icon_box{
            margin: 18px auto 24px auto;
            position: relative;
            width:79px;
            .icon{
                height: 97px;
                width:79px;
            }
            .plus{
                text-align: center;
                position: absolute;
                right: -11px;
                bottom: -7px;
                width: 24px;
                height: 24px;
                line-height: 20px;
                font-size: 20px;
                border-radius: 50%;
                background-color: #fff;
                box-shadow: 0px 4px 32px 4px rgba(0,0,0,0.04), 0px 16px 24px 2px rgba(0,0,0,0.08), 0px 0px 12px 0px rgba(0,0,0,0.16);
                }
        }
        .desc{
            font-size: 14px;
            color: #606266;
            height: 46px;
            line-height: 46px;
            border-top: 1px solid #EBEEF5;
        }
    }
}

</style>
